High Efficiency Video Coding (HEVC) is a new coding standard that has been developed in recent years. In the High Efficiency Video Coding (HEVC) system, the fixed-size macroblock of H.264/AVC is replaced by a flexible block, named coding unit (CU). Pixels in the CU share the same coding parameters to improve coding efficiency. A CU may begin with a largest CU (LCU), which is also referred as coded tree unit (CTU) in HEVC. In addition to the concept of coding unit, the concept of prediction unit (PU) is also introduced in HEVC. Once the splitting of CU hierarchical tree is done, each leaf CU is further split into one or more prediction units (PUs) according to prediction type and PU partition. Several coding tools for screen content coding have been developed. The palette coding tool related to the present invention is briefly reviewed as follow.
For palette coding, a palette is utilized to represent a given video block (e.g. CU) with limited number of values. The major components used for palette coding include:                1. Palette table. The palette table is used to map each palette color in the palette to a palette index.        2. Color index map. With the palette table defined, each pixel value in the current block is mapped to an index. The mapped indices for a block are referred as a color index map. The color index map may also be referred as an index map.        3. Palette predictor. In order to allow a decoder to reconstruct pixel values from palette indices, the palette table has to be signaled to the decoder. In order to reduce the data required for signaling the palette table, predictive coding is applied to the palette table. In particular, a previous palette table is used to predict the palette of the current block or shared by the current block.        
The decoding and parsing process are briefly described as follows. Before the pixel values can be reconstructed from palette indices, the palette table has to be reconstructed. The signaling process for the palette table at the encoder side is described as follows.                1. Signaling ‘palette sharing flag’ first. The palette sharing flag indicates whether the current block shares the palette from a previous coded block. When the palette sharing flag is equal to 1, the current block shares the palette of a previous coded block. In other words, the palette predictor is used as the current palette in this case. If the palette sharing flag is equal to 0, it indicates that the palette is not shared. The palette for the current block has to be signaled as described in step 2, where the current palette is coded predictively based on the previous palette.        2. The palette for the current block is predicted using the previous palette as a predictor. The coded information for the current palette is described as follows.                    a. Signaling ‘reused flags’. The reused flags indicate whether the elements of the palette predictor are used in current palette, where a “1” indicated “reused” and a “0” indicates “not reused”. The reused flags can identify these elements reused in the palette predictor.            b. Signaling ‘the number of non-predicted elements’. For the not predicted elements in the current palette, the elements have to be signaled. The number of non-predicted elements indicates the total number of elements in the current palette to be signaled.            c. Signaling the value of each non-predicted element. After the number of non-predicted elements is signaled, the values of these non-predicted elements are signaled.                        
While the above procedure describes the signaling of the palette for the current palette, the decoder can reconstruct the palette accordingly.
After the palette is signaled, the color index map can be signaled as follows. First, the indices of the block (i.e., the color index map) are processed according to a horizontal raster scan order, vertical raster order, horizontal traverse scan order or vertical traverse order. The indices in the scan order are then run-length coded, where for each position of the indices in the scan order, a flag is first transmitted to indicate the prediction mode as ‘copy above mode’ or ‘copy index mode’.                1. ‘copy above mode’. This run mode indicates that the indices starting from the current position in the scan order are the same as these indices above for consecution N indices (including the index in the current position). N is referred as ‘number of runs’. The ‘copy above mode’ is first signaled using a mode flag and is followed by the ‘number of runs’.        2. ‘copy index mode’ (also referred as “new run mode”). This run mode indicates that the indices starting from the current position in the scan order are the same as the leading non-ESCAPE index for consecution N indices (including the index in the current position). The ‘copy index mode’ is first signaled using a mode flag and is followed by the index and then the ‘number of runs’. If the index is ESCAPE, the ‘copy index mode’ is first signaled using a mode flag and is followed by the index and then the pixel value.        
FIGS. 1A-C illustrate an exemplary of palette index map and palette index map coding according to screen content coding test model 2.0 (SCM-2.0). FIG. 1A illustrates a palette index map with palette indices 0 through 3 for palette colors and palette index 4 for Escape samples. The index corresponding to Escape samples is also referred as an Escape index in this disclosure. FIG. 1B illustrates palate index map coding according to SCM-2.0, where “copy-index mode” is applied to four groups (110, 120, 130 and 140) of the indices in the first row with “palette runs” corresponding to 3, 1, 2, and 6. FIG. 1C illustrates an example of palette index map coding for the second row, wherein “copy-above mode” is applied to the first group of samples (150) and “copy-index mode” is applied to the next two groups (160 and 170) with runs corresponding to 8, 1 and 3.
According to the existing palette coding, each escape pixel is signaled using “copy index mode”, where the mode flag, index and pixel value are transmitted. When palette size is equal to zero and all pixels are escape pixels in a palette coded block (e.g. CU), the values are signaled individually using the mode flag, index and pixel value. In the case, the process is roughly the same as using PCM (Pulse-Code Modulation) mode as in AVC and HEVC, which may introduce duplication and thus is not efficient from coding perspective. Therefore, it is desirable to develop coding method to remove the redundancy and improve the coding efficiency when palette mode is enabled. Furthermore, it is desirable to develop efficient coding for the case that all samples in a block are escape samples.